package com.timesheet.gui.efforttracker.providers;

import java.util.List;
import java.util.Map;

import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;

import com.timesheet.gui.efforttracker.container.UtilisationModelContainer;
import com.timesheet.server.common.models.EffortTrackerDTO;

public class UtilisationContentProvier implements IStructuredContentProvider {

	@Override
	public void dispose() {

	}

	@Override
	public void inputChanged(Viewer arg0, Object arg1, Object arg2) {

	}

	@Override
	public Object[] getElements(Object input) {
		if (input instanceof UtilisationModelContainer) {
			UtilisationModelContainer modelContainer = (UtilisationModelContainer) input;
			List<EffortTrackerDTO> utilisationList = modelContainer.getUtilisationList();
			//Map<String, EffortTrackerDTO> hoursList = modelContainer.getUtilisationMap();
			if (utilisationList != null) {
				return utilisationList.toArray();
			}
		}
		return null;
	}

}
